//--------------------------------------------------------------------------------
// This file is a portion of the D2D1Renderer.  It is distributed
// under the MIT License, available in the root of this distribution and 
// at the following URL:
//
// http://www.opensource.org/licenses/mit-license.php
//
// Copyright (c) Mirco Timmermann
//
//--------------------------------------------------------------------------------
#include "Color.h"

Color const Color::RED = Color(1, 0, 0);
Color const Color::GREEN = Color(0, 1, 0);
Color const Color::BLUE = Color(0, 0, 1);
Color const Color::WHITE = Color(1, 1, 1);
Color const Color::BLACK = Color(0, 0, 0);
Color const Color::GRAY = Color(0.5f, 0.5f, 0.5f);

Color::Color() {
	Color(0, 0, 0);
}

Color::Color(float _r, float _g, float _b, float _a) {
	r = _r;
	g = _g;
	b = _b;
	a = _a;
}

Color::~Color(void) {
	
}

Color Color::operator + (const Color &c) const {
	Color color;

	color.r = c.r + this->r;
	color.g = c.g + this->g;
	color.b = c.b + this->b;
	color.a = c.a + this->a;

	return color;
}

Color Color::operator - (const Color &c) const {
	Color color;

	color.r = this->r - c.r;
	color.g = this->g - c.g;
	color.b = this->b - c.b;
	color.a = this->a - c.a;

	return color;
}

Color Color::operator * (const Color &c) const {
	Color color;

	color.r = this->r * c.r;
	color.g = this->g * c.g;
	color.b = this->b * c.b;
	color.a = this->a * c.a;

	return color;
}

Color Color::operator / (const Color &c) const {
	Color color;

	color.r = this->r / c.r;
	color.g = this->g / c.g;
	color.b = this->b / c.b;
	color.a = this->a / c.a;

	return color;
}

Color Color::operator * (const float& v) const {
	Color color;

	color.r = this->r * v;
	color.g = this->g * v;
	color.b = this->b * v;
	color.a = this->a * v;

	return color;
}

Color Color::operator / (const float& v) const {
	Color color;

	color.r = this->r / v;
	color.g = this->g / v;
	color.b = this->b / v;
	color.a = this->a / v;

	return color;
}